package spring.annotation;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class annotationTest {

    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("annotation.xml");
        User user = (User)applicationContext.getBean("user");
        user.setUsername("shiqi");
        UserDao userDao = (UserDao)applicationContext.getBean("userDao");
        System.out.println(userDao.getUser().getUsername());
        UserService userService = (UserService)applicationContext.getBean("userService");
        userService.getUserDao().save();
    }
}
